package cn.wolfcode.trip.base.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 问题实体;类
 */
@Setter
@Getter
@JsonIgnoreProperties("handler")
public class Question extends BaseDomain{

    //标题
    private String title;
    //内容
    private String content;
    //封面
    private String coverUrl;
    //用户
    private User user;
    //发布时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GTM+8")
    private Date releaseTime;
    //顶数量 默认为0
    private Integer likeNum=0;
    //浏览量 默认为0
    private Integer pageViews=0;
    //地区
    private Region region;

    //关联回答
    private List<Answer> answers=new ArrayList<>();

}